<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
 String contextPath = request.getContextPath();
%>
<html>
<head>
<meta http-equiv=content-type content="text/html; charset=UTF-8">
<title>往期团购 | 玩乐团</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" href="<%=contextPath%>/css/css.css" type="text/css"/>
<script type="text/javascript" src="<%=contextPath%>/js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="<%=contextPath%>/js/javascript.js"></script>
<script type="text/javascript">

</script>
</head>
<body>
<div id="doc"> 

<jsp:include page="/template/top.jsp"></jsp:include>
   <div id="bd" class="cf">
      <div id="recent-deals">
        <div id="content">
          <div class="box">
            <div class="box-top"></div>
            <div class="box-content">
              <div class="head">
                <h2>往期团购</h2>
              </div>
              <div class="sect">
                <ul class="deals-list">
				<s:iterator value="preProducts" status="prdtIndex">
				  <s:if test="#prdtIndex.index <= 1">
				      <s:if test="#prdtIndex.odd == true">
	                  <li class=" first" style="border-bottom:1px dashed #ccc;">
						  <p class="time"><s:property value="startDate"/></p>
						  <h4><a href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank"><s:property value="title"/></a></h4>
						  <div class="pic"> 
						    <s:if test="flag == 1">
						    <div class="isopen"></div>
						    </s:if>
						    <a class="isopenlink" style="display:" href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank"><s:property value="title"/></a>
						    <a  href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank">
						    <img alt="${title}" src="${mainPic}" class="thumbImage" width=200 height=121>
						    </a>
						   </div>
						  <div class="info">
						    <p class="total"><strong class="count"><s:property value="manualPurchaseNumber"/></strong>人购买</p>
						    <p class="price">原价：<strong class="old"><span class="money">¥</span><s:property value="originalPrice"/></strong><br />
								折扣：<strong class="discount"><s:property value="discount"/>折</strong><br/>
								现价：<strong><span class="money">¥</span><s:property value="realPrice"/></strong><br/>
								节省：<strong><span class="money">¥</span><s:property value="save"/></strong><br/>
						    </p>
	                      </div>
	                   </li>
	                   </s:if>
	                   <s:else>
						<li class="alt first" style="border-bottom:1px dashed #ccc;">
						  <p class="time"><s:property value="startDate"/></p>
						  <h4><a href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank"><s:property value="title"/></a></h4>
						  <div class="pic"> 
						    <s:if test="flag == 1">
						    <div class="isopen"></div> 
						    </s:if>
						    <a class="isopenlink" style="display:" href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank"><s:property value="title"/></a>
						    <a  href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank">
						    <img alt="${title}" src="${mainPic}" class="thumbImage" width=200 height=121>
						    </a>
						   </div>
						  <div class="info">
						    <p class="total"><strong class="count"><s:property value="manualPurchaseNumber"/></strong>人购买</p>
						    <p class="price">原价：<strong class="old"><span class="money">¥</span><s:property value="originalPrice"/></strong><br />
								折扣：<strong class="discount"><s:property value="discount"/>折</strong><br/>
								现价：<strong><span class="money">¥</span><s:property value="realPrice"/></strong><br/>
								节省：<strong><span class="money">¥</span><s:property value="save"/></strong><br/>
						    </p>
	                      </div>
						</li>
					   </s:else>
					</s:if>
					<s:else>
					    <!-- deal with lines later than first -->
						<s:if test="#prdtIndex.odd == true">
						<li class=" " style="border-bottom:1px dashed #ccc;">
						 <p class="time"><s:property value="startDate"/></p>
						  <h4><a href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank"><s:property value="title"/></a></h4>
						  <div class="pic"> 
						    <s:if test="flag == 1">
						    <div class="isopen"></div>
						    </s:if> 
						    <a class="isopenlink" style="display:" href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank"><s:property value="title"/></a>
						    <a  href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank">
						    <img alt="${title}" src="${mainPic}" class="thumbImage" width=200 height=121>
						    </a>
						   </div>
						  <div class="info">
						    <p class="total"><strong class="count"><s:property value="manualPurchaseNumber"/></strong>人购买</p>
						    <p class="price">原价：<strong class="old"><span class="money">¥</span><s:property value="originalPrice"/></strong><br />
								折扣：<strong class="discount"><s:property value="discount"/>折</strong><br/>
								现价：<strong><span class="money">¥</span><s:property value="realPrice"/></strong><br/>
								节省：<strong><span class="money">¥</span><s:property value="save"/></strong><br/>
						    </p>
	                      </div>
						</li>
						</s:if>
						<s:else>
						<li class="alt " style="border-bottom:1px dashed #ccc;">
						  <p class="time"><s:property value="startDate"/></p>
						  <h4><a href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank"><s:property value="title"/></a></h4>
						  <div class="pic"> 
						    <s:if test="flag == 1">
						    <div class="isopen"></div> 
						    </s:if>
						    <a class="isopenlink" style="display:" href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank"><s:property value="title"/></a>
						    <a  href="<%=contextPath%>/productView.action?productId=${productId}" title="${title}" target="_blank">
						    <img alt="${title}" src="${mainPic}" class="thumbImage" width=200 height=121>
						    </a>
						   </div>
						  <div class="info">
						    <p class="total"><strong class="count"><s:property value="manualPurchaseNumber"/></strong>人购买</p>
						    <p class="price">原价：<strong class="old"><span class="money">¥</span><s:property value="originalPrice"/></strong><br />
								折扣：<strong class="discount"><s:property value="discount"/>折</strong><br/>
								现价：<strong><span class="money">¥</span><s:property value="realPrice"/></strong><br/>
								节省：<strong><span class="money">¥</span><s:property value="save"/></strong><br/>
						    </p>
	                      </div>
						</li>
						</s:else>
					</s:else>
				</s:iterator>
                </ul>
                <div class="clear"></div>
                <ul class="paginator">
                   <s:if test="pageNow==1">
					<li>首页</li>
					<li>上一页</li>
				   </s:if>
				   <s:else>
				    <li><a href="<%=contextPath%>/productList!listPreviousProducts.action?pageNow=1">首页</a></li>
					<li><a href="<%=contextPath%>/productList!listPreviousProducts.action?pageNow=${pageNow-1}">上一页</a></li>
				   </s:else>
				   
				   <s:if test="pageNow==1">
					<li class="current">1</li> 
				   </s:if>
				   <s:else>
				    <li><a href="<%=contextPath%>/productList!listPreviousProducts.action?pageNow=1">1</a></li> 
				   </s:else>
				   
				   <%
				   //preserve less than five elements before current page
				   int pageNo = (Integer)request.getAttribute("pageNow");
				   int pageTotalNo = (Integer)request.getAttribute("pageTotalNo");
				   if(pageNo-5>=3){
					   out.print("...");
					   for(int i=pageNo-5;i<pageTotalNo&&i<pageNo;i++){
						   out.print("<li><a href='"+contextPath+"/productList!listPreviousProducts.action?pageNow="+i+"'>"+i+"</a></li>");
					   }
				   }else{
					   for(int i=2;i<pageTotalNo&&i<pageNo;i++){
						   out.print("<li><a href='"+contextPath+"/productList!listPreviousProducts.action?pageNow="+i+"'>"+i+"</a></li>");
					   }
				   }
				   if(pageNo >1 && pageNo<pageTotalNo){
				   	out.println("<li class='current'>"+pageNo+"</li>");
				   }
				  
				   %>
				   <%
				   //preserve less than five elements after current page
				   
				    if(pageNo+5<=pageTotalNo-2){
					   for(int i=pageNo+1;i<=pageTotalNo-2;i++){
						   out.print("<li><a href='"+contextPath+"/productList!listPreviousProducts.action?pageNow="+i+"'>"+i+"</a></li>");
					   }
					   out.print("...");
				   }else{
					   for(int i=pageNo+1;i<pageTotalNo;i++){
						   out.print("<li><a href='"+contextPath+"/productList!listPreviousProducts.action?pageNow="+i+"'>"+i+"</a></li>");
					   }
				   }
				   %>
					
				   <s:if test="pageNow.equals(pageTotalNo) && pageTotalNo>1">
					<li class="current"><s:property value="pageTotalNo"/></li> 
				   </s:if>
				   <s:elseif test="pageTotalNo>1">
				    <li><a href="<%=contextPath%>/productList!listPreviousProducts.action?pageNow=${pageTotaNo}"><s:property value="pageTotalNo"/></a></li> 
				   </s:elseif>
				   <s:if test="pageNow.equals(pageTotalNo)">
					<li>下一页</li>
					<li>末页</li>
				   </s:if>
				   <s:elseif test="pageTotalNo>1">
				    <li><a href="<%=contextPath%>/productList!listPreviousProducts.action?pageNow=${pageNow+1}">下一页</a></li>
					<li><a href="<%=contextPath%>/productList!listPreviousProducts.action?pageNow=${pageTotalNo}">末页</a></li>
				   </s:elseif>
                </ul>
              </div>
            </div>
            <div class="box-bottom"></div>
          </div>
        </div>
        <div id="sidebar">
		<div class="sbox side-invite-tip">

            <div class="sbox-top"></div>
            <div class="sbox-content">
              <div class="tip">
                <h2>邀请有奖</h2>
                <p class="text">每邀请一位好友首次购买，您将获<strong><span class="money">¥</span>5</strong>元返利</p>
                <p class="link"><a href="http://www.wanletuan.com/account/referrals/">&raquo; 点击获取您的专用邀请链接</a></p>

              </div>
            </div>
            <div class="sbox-bottom"></div>
          </div>
          <div class="clear"></div>
		  <div class="sbox side-vote-tip">
  <div class="sbox-top"></div>
  <div class="sbox-content">
    <div class="tip">

      <h2>小调查</h2>
      <div class="text">
        <p class="mark"><a href="http://www.wanletuan.com/vote/" target="_blank">您最想团购的是什么?</a></p>
        <p>请达人们告诉玩乐团，让玩乐团更好的为您服务！</p>
      </div>
      <div class="link"><a href="http://www.wanletuan.com/vote/" target="_blank"><img src="http://www.wanletuan.com/template/default/images/button-deal-vote.gif" /></a></div>
    </div>

  </div>
  <div class="sbox-bottom"></div>
</div>

        </div>
      </div>
    </div>
    <!-- bd end -->
  <!-- bdw end -->

 <jsp:include page="/template/bottom.jsp"></jsp:include>

<script src="http://s16.cnzz.com/stat.php?id=2373670&web_id=2373670&show=pic" language="JavaScript"></script>
 </div>
<!-- doc end -->
<body>
</html>
